<!DOCTYPE html>
<html>
<head>
    <title>Bootstrap 实例</title>
    <meta charset="utf-8">
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="main">
<volist name="list" id="vo">
<ul class="list-group">
    <li class="list-group-item">{$vo.title}</li>
    <li class="list-group-item">免费 Window 空间托管</li>


</ul>
    <button type="button" class="btn btn-success">成功按钮</button>
</volist>
    </div>
<div class="nodata"></div>


</body>
</html>

<script>



    $(function(){

        $(".btn-success").each(function(){

            $(this).on('click',function(){

                alert("nidianjil");
                return false;
            })
        })




        var winH = $(window).height(); //页面可视区域高度
        var i = 1; //设置当前页数
        $(window).scroll(function () {
            var pageH = $(document.body).height();
            var scrollT = $(window).scrollTop(); //滚动条top
            var aa = (pageH-winH-scrollT)/winH;
            var Url = "http://tutu.leshuju.cn/minhong/index.php/Home/Index/ajax";
            if(aa<0.02){
//                $.getJSON("",{page:i},function(json){
//                    if(json){
//                        var str = "";
//                        $.each(json,function(index,array){
//
//                            var str= "<ul class='list-group'><li class='list-group-item'>+array['title']+</li><li class='list-group-item'>+array['des']+</li><li class='list-group-item'>图像的数量</li><li class='list-group-item'>24*7 支持</li><li class='list-group-item'>每年更新成本</li></ul>";
//
//                            $("#main").append(str);
//                        });
//                        i++;
//                    }else{
//                        $(".nodata").show().html("别滚动了，已经到底了。。。");
//                        return false;
//                    }
//                });


                $.ajax({
                    type: 'get',
                    url: Url,
                    data: {page:i},
                    dataType: 'json',

                    success: function(json){

                        if(json) {

                            var str = "";
                            $.each(json, function (index, array) {

                                var str = "<ul class='list-group'><li class='list-group-item'>"+array['title']+"</li><li class='list-group-item'>"+array.des+"</li></ul><button type='button' class='btn btn-success'>成功按钮</button>";

                                $(".main").append(str);

                            });
                            i++;
                            //正在加载中

                        }else{

                            $(".nodata").html("别滚动了，已经到底了。。。");
                            return false;
                        }
                    },
                    error: function(xhr, type){
                        alert('Ajax error!')
                    }
                });
            }
        });


    })



</script>